﻿using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace VoiceTestPlatform
{
    public class ParityToStrConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Parity s = (Parity)value;
            switch (s)
            {
                case Parity.Even:
                    return "偶校验";
                case Parity.Mark:
                    break;
                case Parity.None:
                    return "无";
                case Parity.Odd:
                    return "奇校验";
                case Parity.Space:
                    break;
                default:
                    return "无";
            }
            return "";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
